﻿/*
* Copyright (c) 2010-2012 Tesla Engine Group
* 
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* 
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* 
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

using Tesla.Math;

namespace Tesla.Graphics {
    /// <summary>
    /// A renderable defines an object that can be rendered to the screen and as thus contains
    /// a set of properties that describe how it should be rendered, and a method to render itself.
    /// </summary>
    public interface IRenderable {

        /// <summary>
        /// Gets or sets the renderable's material.
        /// </summary>
        Material Material {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the renderable's ortho order. When the renderable is used in the ortho render bucket,
        /// it is sorted based on this value (lower values are rendered first and higher values
        /// last).
        /// </summary>
        int OrthoOrder {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the renderable's render bucket type. 
        /// </summary>
        RenderBucketType RenderBucketType {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the renderable's transparency mode to use, one-pass or two-pass.
        /// </summary>
        TransparencyType TransparencyType {
            get;
            set;
        }

        /// <summary>
        /// Gets the renderable's absolute world transform.
        /// </summary>
        Transform WorldTransform {
            get;
        }

        /// <summary>
        /// Gets the absolute collection of world lights that affect the renderable.
        /// </summary>
        ILightCollection WorldLights {
            get;
        }

        /// <summary>
        /// Render the object to the screen.
        /// </summary>
        /// <param name="renderer">Renderer</param>
        void Render(IRenderer renderer);
    }
}
